Skip to content

[#773] Show Market Cap USD + 24h change instead of Token Price#779

Merged
realproject7 merged 3 commits intomainfrom
task/773-storyline-mcap
Apr 2, 2026
Merged

[#773] Show Market Cap USD + 24h change instead of Token Price#779
realproject7 merged 3 commits intomainfrom
task/773-storyline-mcap

Conversation

@realproject7
Copy link
Copy Markdown
Owner

Summary

  • Replaces "Token Price" box with "Market Cap" box on storyline page header
  • Market Cap = totalSupply * pricePerToken * plotUsd, displayed in USD
  • Shows 24h price change percentage with green/red coloring via get24hPriceChange()
  • New MarketCapBox client component handles USD price and 24h change fetching
  • Supply Minted box unchanged

Fixes #773

Test plan

  • Storyline page shows "MARKET CAP" with USD value
  • 24h change shows colored percentage (green positive, red negative)
  • Supply Minted still displays correctly
  • npm run build passes

🤖 Generated with Claude Code

…ine page

Replace the Token Price box in StoryHeader with a Market Cap box
showing totalSupply * pricePerToken * plotUsd in USD, plus 24h
percent change with green/red coloring. Supply Minted box unchanged.

New MarketCapBox client component fetches plotUsd and 24h price
change data client-side.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 2, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
plotlink Ignored Ignored Apr 2, 2026 8:37pm

Request Review

Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

T2b APPROVE

Clean implementation:

  • New MarketCapBox client component properly isolates USD price and 24h change fetching
  • Market cap formula correct: totalSupply * pricePerToken * plotUsd
  • 24h change query uses 60s stale time, consistent with other price queries
  • Returns null while plotUsd loads — no flash of incomplete data
  • Supply Minted box untouched as required

No concerns.

Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: REQUEST CHANGES

Summary

The Market Cap UI change is close, but the new client component bypasses the repo's shared RPC configuration and hardcodes Base mainnet for the 24h change fetch.

Findings

  • [medium] MarketCapBox creates its own createPublicClient({ chain: base, transport: http() }), which ignores NEXT_PUBLIC_CHAIN_ID and the shared fallback/CORS RPC setup in lib/rpc.ts. In Base Sepolia or any non-mainnet environment, this will fetch the 24h change from the wrong chain or fail inconsistently even though the rest of the app uses the environment-aware shared client.
    • File: src/components/MarketCapBox.tsx:11
    • Suggestion: Reuse the existing browser-safe client from lib/rpc.ts (or another shared chain-aware helper) instead of creating a hardcoded Base client inside the component.

Decision

Requesting changes because the current implementation introduces incorrect environment behavior in a shared storyline-header metric.

Replace hardcoded Base mainnet client with the shared chain-aware
browserClient from lib/rpc.ts for correct behavior across environments.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: REQUEST CHANGES

Summary

The chain-aware RPC fix is in place, but the storyline header refactor still leaves unused symbols behind in the page module.

Findings

  • [medium] src/app/story/[storylineId]/page.tsx still imports UsdPriceTag even though the Token Price box was removed, and StoryHeader still declares const reserveLabel = RESERVE_LABEL; without using it. If the repo's lint step treats unused imports/locals as errors, this will fail lint-and-typecheck even though the runtime behavior is otherwise correct.
    • File: src/app/story/[storylineId]/page.tsx:26
    • File: src/app/story/[storylineId]/page.tsx:263
    • Suggestion: Remove the unused UsdPriceTag import and the unused reserveLabel local from StoryHeader.

Decision

Requesting changes because the PR still appears to contain a straightforward lint blocker after the refactor.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: APPROVE

Summary

The follow-up change resolves the remaining issues in the storyline header refactor: MarketCapBox now uses the shared browser RPC client, and the page module cleanup removed the unused import/local left behind by the Token Price replacement.

Findings

  • None.

Decision

Approving because the Market Cap USD + 24h change box now matches issue #773 without the environment regression or lint blocker from the earlier revisions.

@realproject7 realproject7 merged commit 9a48b54 into main Apr 2, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Enhancement] Storyline page: show Market Cap USD + 24h change instead of Token Price

2 participants